import fetch from "./fetch";

// 上传身份证
export const updateCard = (data) =>
  fetch({
    url: "/appletSigning2/characterRecognition",
    method: "POST",
    data,
  });

// 校验身份信息
export const checkInfo = (data) =>
  fetch({
    url: "/appletSigning2/threeElementsCheck",
    method: "POST",
    data,
  });

/* 发送验证码 */
export const sendSms = (data) =>
  fetch({
    url: `/appletSigning2/sendSms`,
    method: "POST",
    data,
  });

/* 校验验证码 */
export const verifySms = (data) =>
  fetch({
    url: `/appletSigning2/verifySms`,
    method: "POST",
    data,
  });

/* 个人中心数据 */
export const getPersonalInfo = (data) =>
  fetch({
    url: `/appletSigning2/findPersonal`,
    method: "POST",
    data,
  });

/* 收益记录 */
export const cheqRecode = (data) =>
  fetch({
    url: `/appletSigning2/findOrder`,
    method: "POST",
    data,
  });

/* 是否签约判断接口 */
export const checkSign = (data) =>
  fetch({
    url: `/appletSigning2/whetherSignedSuccess`,
    method: "POST",
    data,
  });

/* 立即签约 */
export const confirmBySign = (data) =>
  fetch({
    url: `/appletSigning2/bank3Factors`,
    method: "POST",
    data,
  });

/* 个人信息 */
export const getUserInfo = (data) =>
  fetch({
    url: `/appletSigning2/findPersonalInfo`,
    method: "POST",
    data,
  });

/* 任务列表 * 未抢单 */
export const getTaskList = (data) =>
  fetch({
    url: `/appletSigning2/findMerchantTask`,
    method: "POST",
    data,
  });

/* 任务列表 * 已抢单 */
export const getRobbedList = (data) =>
  fetch({
    url: `/appletSigning2/findRobbedTask`,
    method: "POST",
    data,
  });

/* 任务列表 - 立即下单 */
export const submitOrderByTask = (data) =>
  fetch({
    url: `/appletSigning2/taskReceipt`,
    method: "POST",
    data,
  });

/* 任务列表 - 交付任务 */
export const confirmOrderByTask = (data) =>
  fetch({
    url: `/appletSigning2/endTask`,
    method: "POST",
    data,
  });

/* 任务列表 - 自动接单 */
export const autoAcceptOrder = (data) =>
  fetch({
    url: `/appletSigning2/updAutoMerchantTask`,
    method: "POST",
    data,
  });

/**
 * @description 微信授权登录
 * @param {mobile, code} data
 */
export const getAuthByWechat = (data) =>
  fetch({
    url: `/appletSigning2/code2Session`,
    method: "POST",
    data,
  });

/**
 * @description 获取《数字经济合作伙伴协议》接口
 * @param {} data
 */
export const getProtocolBySign = () =>
  fetch({
    url: `/appletSigning2/getDigitalEconomyPartnershipAgreement`,
    method: "POST",
  });

/**
 * @description 获取任务列表-协议
 * @param { id: '' } data
 */
export const getProtocolByTask = (data) =>
  fetch({
    url: `/appletSigning2/getContractAddress`,
    method: "POST",
    data,
  });

/**
 * @description 获取任务详情
 * @param { id: '' } data
 */
export const getDetailByTask = (data) =>
  fetch({
    url: `/appletSigning2/taskDetails`,
    method: "POST",
    data,
  });

/**
 * @description 支付/取消任务
 * @param { id: '' } data
 */
export const updateOrderByTask = (data) =>
  fetch({
    url: `/appletSigning2/deliverTasks`,
    method: "POST",
    data,
  });

/* 任务广场 * 列表 */
export const getTaskListBySquare = (data) =>
  fetch({
    url: `/appletSigning2/findMerchantTaskNoOrder`,
    method: "POST",
    data,
  });

/**
 * @description 合同信息
 * @param {loginAccount: ''} data
 */
export const getContractList = (data) =>
  fetch({
    url: `/appletSigning2/contractList`,
    method: "POST",
    data,
  });

/**
 * @description 个人履历
 * @param {loginAccount: ''} data
 */
export const getResumeList = (data) =>
  fetch({
    url: `/appletSigning2/queryResumeByMobile`,
    method: "POST",
    data,
  });

/**
 * @description 课程编号列表
 * @param {} data
 */
export const getLessonList = (data) =>
  fetch({
    url: `/appletSigning2/getLessonNoList`,
    method: "GET",
    data,
  });

/**
 * @description 个人证书列表
 * @param {} data
 */
export const getCertificateList = (data) =>
  fetch({
    url: `/appletSigning2/statisticsData`,
    method: "GET",
    data,
  });

/**
 * @description 课程记录列表
 * @param {} data
 */
export const getListByLessonRecord = (data) =>
  fetch({
    url: `/appletSigning2/recentlyPlayedVideos`,
    method: "GET",
    data,
  });

/**
 * @description 人脸识别-获取BizToken appletSigning/getBizToken.json
 * @param {IdCard, UserName} data
 */
export const getBizTokenByFace = (data) =>
  fetch({
    url: `/appletSigning2/getBizToken.json`,
    method: "GET",
    data,
  });

/**
 * @description 个人信息-修改银行卡号
 * @param {phone, bankCard} data
 */
export const changeBankCard = (data) =>
  fetch({
    url: `/appletSigning2/modifyBankCardNumber`,
    method: "POST",
    data,
  });

/**
 * @description 定位
 * @param {taskNumber, lat, lng} data
 */
export const clockIn = (data) =>
  fetch({
    url: `/appletSigning2/addressJudgment`,
    method: "POST",
    data,
  });

/**
 * @description 定位
 * @param {phone, name, adresses, getTime} data
 */
export const certificateUpload = (data) =>
  fetch({
    url: `/appletSigning2/certificateSubmission`,
    method: "POST",
    data,
  });

/**
 * @description 健康状况列表
 * @param {} data
 */
export const getHealthList = (data) =>
  fetch({
    url: `/appletSigning2/getStateOfHealthList`,
    method: "GET",
    data,
  });

/**
 * @description 提交健康状况
 * @param {} data
 */
export const submitHealth = (data) =>
  fetch({
    url: `/appletSigning2/saveStateOfHealth`,
    method: "POST",
    data,
  });
